/**
 * 主路由
 * @description 管理登录，404路由
 */
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {LoginComponent} from './login/login/login.component';
import {PageNotFoundComponent} from "./page-not-found/page-not-found.component";
import {ForgotPwdStep1Component} from "./login/forgot-pwd-step1/forgot-pwd-step1.component";
import {ForgotPwdStep2Component} from "./login/forgot-pwd-step2/forgot-pwd-step2.component";
import {MainGuard} from "./grauds/main.guard";


const AppRoutings: Routes = [
  {path: 'login', component: LoginComponent}, // 登录
  {path: 'forgot-pwd-step1', component: ForgotPwdStep1Component}, // 找回密码第一步
  {path: 'forgot-pwd-step2', component: ForgotPwdStep2Component} // 找回密码第二步
  , {path: 'main', loadChildren: './main/main.module#MainModule', canActivate:[MainGuard]} // 商户数据
  , {path: '', redirectTo: 'login', pathMatch: 'full'}
  , {path: '**', component: PageNotFoundComponent}
];

@NgModule({
  imports: [RouterModule.forRoot(AppRoutings)],
  exports: [RouterModule]
})
export class AppRoutingModule{}
